﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:BadHabit_Factory_Converters="clr-namespace:BadHabit.Factory.Converters"
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"
    xmlns:BadHabit_WPFTools_Converters="clr-namespace:BadHabit.WPFTools.Converters;assembly=BadHabit.WPFTools"
    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options">

    <BadHabit_WPFTools_Converters:LocalizeConverter x:Key="LocalizeConverter"/>


   

    <DataTemplate x:Key="BacklogItemStatusTemplate">                    
        <Grid HorizontalAlignment="Stretch">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Image Grid.Column="0" Style="{StaticResource BacklogItemStatusImage}" Margin="0,0,5,0" Width="24" Height="24"/>
            <TextBlock Grid.Column="1" Text="{Binding ., Converter={StaticResource LocalizeConverter}}" HorizontalAlignment="Stretch"/>
        </Grid>        
    </DataTemplate>

    <DataTemplate x:Key="SizeItemTemplate">
        <Grid MaxWidth="400">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="40"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Column="0" Text="{Binding SizeValue}"
                                           FontSize="22" FontFamily="Impact"
                                           Foreground="Red" Margin="0,0,5,0"
                                           VerticalAlignment="Center"                                           
                                           HorizontalAlignment="Center"
                                           />
            <StackPanel Grid.Column="1">
                <TextBlock Text="{Binding Name}" Foreground="{StaticResource DarkTextBrush}"/>
                <TextBlock Text="{Binding Description}" Foreground="Gray" TextWrapping="Wrap"/>
            </StackPanel>
        </Grid>
    </DataTemplate>

    <DataTemplate x:Key="TaskStatusTemplate">
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="Transparent">
            <Image Style="{StaticResource TaskStatusImage}" Width="24" Height="24" Stretch="Uniform"/>
            <TextBlock Text="{Binding ., Converter={StaticResource LocalizeConverter}}" Margin="2,0,0,0" HorizontalAlignment="Stretch"/>
        </StackPanel>
    </DataTemplate>

    <DataTemplate x:Key="TaskTypeTemplate">
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Background="Transparent">
            <Image Style="{StaticResource TaskTypeImage}" Width="24" Height="24"/>
            <TextBlock Text="{Binding .,Converter={StaticResource LocalizeConverter}}" Margin="2,0,0,0" HorizontalAlignment="Stretch"/>
        </StackPanel>
    </DataTemplate>




    <!-- DEFAULT COMBOBOX TOGGLE BUTTON -->
    <!-- IS BASIC A DOWN ARROW -->
    <ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="20" />
            </Grid.ColumnDefinitions>
            <Border
                x:Name="Border" 
                Grid.ColumnSpan="2"
                CornerRadius="2"
                Background="{TemplateBinding Background}"
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="1" />            
            <Border 
                x:Name="ToggleBorder"
                Grid.Column="0"
                CornerRadius="2,0,0,2" 
                Margin="1" 
                Cursor="Arrow"                
                Background="Transparent"                 
                BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="0,0,1,0" />
            <Path                 
                x:Name="Arrow"
                Grid.Column="1"     
                Fill="{TemplateBinding Foreground}"
                HorizontalAlignment="Center"
                VerticalAlignment="Center"
                Data="M 0 0 L 4 4 L 8 0 Z"/>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="ToggleButton.IsMouseOver" Value="true">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource HighLightBrush}" />                
                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}" />
                <Setter TargetName="ToggleBorder" Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}" />
            </Trigger>
            <Trigger Property="ToggleButton.IsChecked" Value="true">
                <Setter TargetName="Border" Property="Background" Value="{StaticResource SelectedItemBrush}" />
                <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="False">
                <Setter TargetName="Border" Property="Background" Value="Transparent" />
                <!--<Setter TargetName="Border" Property="BorderBrush" Value="Transparent" />-->
                <!--<Setter Property="Foreground" Value="Transparent"/>-->
                <!--<Setter TargetName="Arrow" Property="Fill" Value="Transparent" />-->
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    

    <ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox">
        <Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
    </ControlTemplate>

    <Style x:Key="{x:Type BadHabit_WPFTools:ComboBox}" TargetType="{x:Type BadHabit_WPFTools:ComboBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="DropDownBackground" Value="{StaticResource FormInputBackgroundBrush}"/>
       
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type BadHabit_WPFTools:ComboBox}">
                    <Grid>
                        <ToggleButton 
                            Name="ToggleButton"                             
                            Template="{StaticResource ComboBoxToggleButton}" 
                            Grid.Column="2" 
                            Focusable="False"
                            
                            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                            ClickMode="Press"                            
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Foreground="{TemplateBinding Foreground}"/>
                            
                        <ContentPresenter
                            Name="ContentSite"
                            IsHitTestVisible="False" 
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding SelectedItemTemplate}"
                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            
                            Margin="6,3,23,3"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Left"/>
                        
                        <TextBox x:Name="PART_EditableTextBox"
                            Style="{x:Null}" 
                            Template="{StaticResource ComboBoxTextBox}" 
                            HorizontalAlignment="Left" 
                            VerticalAlignment="Center" 
                            Margin="6,3,23,3"
                            Focusable="True" 
                            Background="Transparent"
                            Visibility="Hidden"
                            IsReadOnly="{TemplateBinding IsReadOnly}"/>
                        <Popup 
                            Name="Popup"                            
                            VerticalOffset="-2"
                            Placement="Bottom"                            
                            IsOpen="{TemplateBinding IsDropDownOpen}"
                            AllowsTransparency="True" 
                            Focusable="False"
                            PopupAnimation="Slide">           
                            <StackPanel Orientation="Vertical">
                                <Polygon
                                        PresentationOptions:Freeze="True"
                                        Fill="{StaticResource DarkTextBrush}"
                                         Points="11,0 21,5 0,5"
                                         HorizontalAlignment="Center"
                                         StrokeThickness="1"
                                         VerticalAlignment="Top"
                                         Margin="0,0,0,0"/>
                                <Grid 
                                  Name="DropDown"
                                  Margin="0,-2,0,0"
                                  SnapsToDevicePixels="True"                
                                  MinWidth="{TemplateBinding ActualWidth}"
                                  MaxHeight="{TemplateBinding MaxDropDownHeight}">


                                    <Border 
                                    x:Name="DropDownBorder"
                                    Background="{TemplateBinding DropDownBackground}"
                                    BorderThickness="1"
                                    BorderBrush="{StaticResource DarkTextBrush}">
                                        <Border BorderBrush="LightGray" BorderThickness="1,1,0,0" CornerRadius="4">
                                            <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Disabled">
                                                <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />
                                            </ScrollViewer>
                                        </Border>
                                    </Border>
                                </Grid>
                            </StackPanel>
                      
                        </Popup>
                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>                        
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable" Value="true">
                            <Setter Property="IsTabStop" Value="False"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility"    Value="Visible"/>
                            <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter Property="IsTabStop" Value="False"/>
                            <!--<Setter TargetName="ToggleButton" Property="Background" Value="Transparent"/>
                            <Setter TargetName="ToggleButton" Property="BorderBrush" Value="Transparent"/>-->
                            <!--<Setter TargetName="ToggleButton" Property="IsChecked" Value="False"/>-->
                            <Setter TargetName="ToggleButton" Property="IsEnabled" Value="False"/>
                        </Trigger>
                        
                    </ControlTemplate.Triggers>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <!--<Style.Triggers>            
                    <Trigger Property="IsReadOnly" Value="True">
                        <Setter Property="IsEnabled" Value="False"/>
                    </Trigger>            
        </Style.Triggers>-->
        
    </Style>


    <Style x:Key="ClickOnComboBox"  TargetType="{x:Type BadHabit_WPFTools:ComboBox}">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
        <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="DropDownBackground" Value="{StaticResource FormInputBackgroundBrush}"/>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type BadHabit_WPFTools:ComboBox}">                                            
                            <Grid>
                        <ToggleButton 
                            Name="ToggleButton"                     
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Margin="0"
                            Padding="0"
                            Focusable="false"
                            IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
                            ClickMode="Press"                            
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            Foreground="{TemplateBinding Foreground}">

                            <Grid>
                                <ContentPresenter
                            Name="ContentSite"
                            IsHitTestVisible="False" 
                            Content="{TemplateBinding SelectionBoxItem}"
                            ContentTemplate="{TemplateBinding SelectedItemTemplate}"
                            ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
                            Margin="0,0,0,0"
                            
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>

                                <TextBox x:Name="PART_EditableTextBox"
                            Style="{x:Null}" 
                            Template="{StaticResource ComboBoxTextBox}"                             
                       
                            HorizontalAlignment="Left" 
                            VerticalAlignment="Center" 
                            Margin="0,0,0,0"
                            Focusable="True" 
                            Background="Transparent"
                            Visibility="Hidden"
                            IsReadOnly="{TemplateBinding IsReadOnly}"/>



                            </Grid>

              
                        </ToggleButton>

            

                                <Popup 
                                    Name="Popup"
                                    VerticalOffset="-2"
                                    Placement="Bottom"
                                    IsOpen="{TemplateBinding IsDropDownOpen}"
                                    AllowsTransparency="True" 
                                    Focusable="False"
                                    PopupAnimation="Slide">
                                    
                         
                            <Border 
                                    x:Name="DropDownBorder"
                                    Background="{TemplateBinding DropDownBackground}"
                                    BorderThickness="1"
                                    BorderBrush="DarkGray">
                                <ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Disabled">
                                    <ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" KeyboardNavigation.DirectionalNavigation="Contained" />                                    
                                </ScrollViewer>
                            </Border>
                         
                          
                                </Popup>
                            </Grid>
                        
        
                    <ControlTemplate.Triggers>
                        <Trigger Property="HasItems" Value="false">
                            <Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
                        </Trigger>                       
                        <Trigger Property="IsGrouping" Value="true">
                            <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
                        </Trigger>
                        <Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
                            <Setter TargetName="DropDownBorder" Property="CornerRadius" Value="4"/>
                            <Setter TargetName="DropDownBorder" Property="Margin" Value="0,2,0,0"/>
                        </Trigger>
                        <Trigger Property="IsEditable" Value="true">
                            <Setter Property="IsTabStop" Value="false"/>
                            <Setter TargetName="PART_EditableTextBox" Property="Visibility"    Value="Visible"/>
                            <Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
                        </Trigger>
                        <Trigger Property="IsReadOnly" Value="True">
                            <Setter Property="IsEnabled" Value="False"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
        </Style.Triggers>
    </Style>







    <Style x:Key="FormComboBox" TargetType="{x:Type BadHabit_WPFTools:ComboBox}" BasedOn="{StaticResource {x:Type BadHabit_WPFTools:ComboBox}}">
        <Setter Property="Margin" Value="2,2,2,2"/>
        <Setter Property="Foreground" Value="Black"/>
        <Setter Property="Background" Value="{StaticResource FormInputBackgroundBrush}"/>
        <Setter Property="DropDownBackground" Value="{StaticResource FormInputBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource FormInputBorderBrush}"/>
        <Setter Property="VerticalAlignment"  Value="Center"/>
    </Style>

    


    <Style TargetType="ComboBoxItem">
        <Setter Property="Template">
            <Setter.Value>                
                <ControlTemplate TargetType="ComboBoxItem">
                    <Border x:Name="border" Style="{StaticResource HighLightBorderBase}" Margin="0,0,0,0">
                        <ContentPresenter x:Name="content" TextBlock.FontFamily="{StaticResource BasicFont}" TextBlock.FontSize="{StaticResource BasicFontSize}" Margin="0,0,0,0" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">                            
                            <Setter TargetName="border" Property="Background" Value="{StaticResource HighLightBrush}"/>
                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}"/>                            
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ListBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">                                
                    <Border x:Name="border" Style="{StaticResource HighLightBorder}" Margin="0" >
                        <ContentPresenter x:Name="content" Margin="0,0,0,0" />
                    </Border>            
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter  TargetName="border" Property="Background" Value="{StaticResource SelectedItemBrush}"/>
                            <Setter TargetName="border"  Property="TextBlock.Foreground" Value="{StaticResource DarkTextBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="NoSelectionListBoxItem" TargetType="ListBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">                    
                    <ContentPresenter x:Name="content" Margin="0,0,0,0" />                                       
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style x:Key="{x:Type ListViewItem}" TargetType="ListViewItem">
        <Setter Property="SnapsToDevicePixels" Value="true"/>
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border x:Name="border" Style="{StaticResource HighLightBorder}" Margin="0">
                        <GridViewRowPresenter
            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Border>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="HorizontalDividedListBoxItem" TargetType="ListBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ListBoxItem">
                    <Border Style="{StaticResource ListBoxItemBorder}">
                        <Border x:Name="border" Style="{StaticResource HighLightBorder}" Margin="2">
                            <ContentPresenter x:Name="content"  Margin="0,0,0,0"  />
                        </Border>
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource SelectedItemBrush}"/>
                            <Setter TargetName="border"  Property="TextBlock.Foreground" Value="{StaticResource DarkTextBrush}"/>                                                        
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>



    <Style x:Key="TeamComboBoxItem" TargetType="ComboBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ComboBoxItem">
                    <Border x:Name="border" Style="{StaticResource HighLightBorderBase}" Margin="0,0,0,0">
                        <ContentPresenter x:Name="content" TextBlock.FontFamily="{StaticResource BasicFont}" TextBlock.FontSize="{StaticResource BasicFontSize}" Margin="0,0,0,0" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused" Value="True">
                            <Setter TargetName="border" Property="Background" Value="{StaticResource HighLightBrush}"/>
                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource HighLightBorderBrush}"/>
                            <Setter TargetName="content" Property="TextBlock.Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="{StaticResource DarkColor}"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="IsFocused" Value="False">                            
                            <Setter TargetName="content" Property="TextBlock.Foreground">
                                <Setter.Value>
                                    <SolidColorBrush Color="White"/>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style x:Key="TeamMemberImageControl" TargetType="ContentControl">
        <Style.Triggers>
            <DataTrigger Binding="{Binding ClientContactRole}" Value="True">
                <Setter Property="ContentControl.Visibility" Value="Collapsed"/>
            </DataTrigger>
        </Style.Triggers>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Border BorderBrush="Gray" BorderThickness="1" Margin="0,0,3,0" CornerRadius="3">
                        <Border Background="LightGray" CornerRadius="3" Padding="0"  BorderThickness="2">
                            <Border.BorderBrush>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="1,1" >
                                    <GradientStop Color="#FFFFFF" Offset="0"/>
                                    <GradientStop Color="#DDDDDD" Offset="0.5"/>
                                    <GradientStop Color="#AAAAAA" Offset="1"/>
                                </LinearGradientBrush>
                            </Border.BorderBrush>

                            <Border x:Name="memberImageBorder"                     
                                    Margin="0" Padding="0"
                                    CornerRadius="3"
                                    BorderThickness="1"
                                    BorderBrush="Gray">
                                
                                <Border.Background>
                                    <ImageBrush Stretch="Fill" ImageSource="{Binding IsAsync=True, Path=ImageUri}" />                                    
                                </Border.Background>
                                
                                
                                
                                
                            </Border>
                        </Border>                       
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <DataTemplate x:Key="TeamMemberTemplate">
        <Grid Margin="0,1,0,1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <ContentControl Grid.Column="0" Style="{StaticResource TeamMemberImageControl}" Width="44" Height="44" Margin="0,0,3,0" />

            <StackPanel
                                Grid.Column="1"                                
                                Background="Transparent"
                                HorizontalAlignment="Stretch"
                                Orientation="Vertical">
                <TextBlock
                                x:Name="memberLogin"
                                Visibility="Collapsed"
                                Text="{Binding MemberId, StringFormat='{}({0})'}" VerticalAlignment="Center" Foreground="{StaticResource NormalBrush}" FontWeight="Bold"/>
                <TextBlock
                                x:Name="memberName"                                                                
                                Text="{Binding NickName}" VerticalAlignment="Center"/>
                <TextBlock                                
                                x:Name="memberUnit"                                
                                FontSize="9" Text="{Binding DefaultUnitName}" VerticalAlignment="Center"/>
            </StackPanel>
        </Grid>

    </DataTemplate>


    <Style x:Key="TeamComboBox" TargetType="{x:Type BadHabit_WPFTools:ComboBox}" BasedOn="{StaticResource {x:Type BadHabit_WPFTools:ComboBox}}">                
        <Setter Property="DropDownBackground" Value="{StaticResource GradientBlackBrush}"/>        
        <Setter Property="HorizontalAlignment"  Value="Stretch"/>
        <Setter Property="MinWidth"  Value="116"/>
        <Setter Property="ToolTip"  Value="{Binding TaskAssignee}"/>
        <Setter Property="ItemTemplate" Value="{StaticResource TeamMemberTemplate}"/>
        <Setter Property="SelectedValue" Value="{Binding TaskAssignee}"/>
        <Setter Property="SelectedValuePath" Value="MemberId"/>
        <Setter Property="DisplayMemberPath" Value="NickName"/>
        <Setter Property="TextSearch.TextPath" Value="NickName"/>
        <Setter Property="ItemContainerStyle" Value="{StaticResource TeamComboBoxItem}"/>                
    </Style>

    <DataTemplate x:Key="ComboBoxGroupHeaderTemplate">
        <DockPanel>
            <TextBlock Text="{Binding Name}" FontWeight="Bold" DockPanel.Dock="Top" />
            <ItemsPresenter  HorizontalAlignment="Stretch"  />
        </DockPanel>
    </DataTemplate>


    <Style x:Key="SizeComboBox" TargetType="{x:Type BadHabit_WPFTools:ComboBox}" BasedOn="{StaticResource FormComboBox}">
        <Setter Property="DropDownBackground" Value="{StaticResource FormInputBackgroundBrush}"/>               
        <Setter Property="ItemTemplate" Value="{StaticResource SizeItemTemplate}"/>
        <Setter Property="SelectedValue" Value="{Binding SizeItemType}"/>
        <Setter Property="SelectedValuePath" Value="SizeItemType"/>
        <Setter Property="DisplayMemberPath" Value="SizeValue"/>
        <Setter Property="TextSearch.TextPath" Value="Name"/>        
        <Setter Property="IsEditable" Value="False"/>
    </Style>

    <Style x:Key="SizeClickOnComboBox" TargetType="{x:Type BadHabit_WPFTools:ComboBox}" BasedOn="{StaticResource ClickOnComboBox}">
        <Setter Property="DropDownBackground" Value="{StaticResource FormInputBackgroundBrush}"/>
        <Setter Property="ItemTemplate" Value="{StaticResource SizeItemTemplate}"/>
        <Setter Property="SelectedValue" Value="{Binding SizeItemType}"/>
        <Setter Property="SelectedValuePath" Value="SizeItemType"/>
        <Setter Property="DisplayMemberPath" Value="SizeValue"/>
        <Setter Property="TextSearch.TextPath" Value="Name"/>        
        <Setter Property="IsEditable" Value="False"/>
    </Style>


</ResourceDictionary>